﻿@model IEnumerable<MvcDatagrid.Models.Orders>

@{
    ViewBag.Title = "Index";
}

 @{Layout = "~/Views/Shared/_Layout.cshtml";}
 <h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Customers.CompanyName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Employees.LastName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OrderDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.RequiredDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShippedDate)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Shippers.CompanyName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Freight)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipAddress)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipCity)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipRegion)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipPostalCode)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ShipCountry)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Customers.CompanyName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Employees.LastName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OrderDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RequiredDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShippedDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Shippers.CompanyName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Freight)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipAddress)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipCity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipRegion)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipPostalCode)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ShipCountry)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.OrderID }) |
            @Html.ActionLink("Details", "Details", new { id=item.OrderID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.OrderID })
        </td>
    </tr>
}



</table>
